<?php
/**
 * Created by PhpStorm.
 * User: dfh
 * Date: 2016/9/28
 * Time: 18:31
 */
$line=1;
while($line<=5){
    $empty_pos=$star_pos=1;
    $empty=5-$line;
    $star=2*$line-1;
    while($empty_pos<=$empty){
        echo'&ensp;';
        ++$empty_pos;
    }
    while($star_pos<=$star){
        echo'*';
        ++$star_pos;
    }
    echo'<br>';
    ++$line;
}
?>